package com.fowo.api.syncLingxingApi.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fowo.api.syncLingxingApi.entity.TmpSyncLingxingToWarehousebin;
import com.fowo.api.syncLingxingApi.mapper.TmpSyncLingxingToWarehousebinMapper;
import com.fowo.api.syncLingxingApi.service.TmpSyncLingxingToWarehousebinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
@DS("ds24")
public class TmpSyncLingxingToWarehousebinServiceImpl
        extends ServiceImpl<TmpSyncLingxingToWarehousebinMapper, TmpSyncLingxingToWarehousebin>
        implements TmpSyncLingxingToWarehousebinService {
    @Override
    public Integer updateWarehouseBin(String version) {
        return baseMapper.updateToWarehouseBin(version);
    }

    @Override
    public Integer insertIntoWarehouseBin(String version) {
        return baseMapper.insertIntoWarehouseBin(version);
    }

    @Override
    public Integer updateWarehouseBinSkus(String version) {
        return baseMapper.updateWarehouseBinSku(version);
    }

    @Override
    public Integer insertIntoWarehouseBinSkus(String version) {
        return baseMapper.insertIntoWarehouseBinSku(version);
    }

    @Override
    public List<String> getWarehouseId() {
        return baseMapper.getWarehouseId();
    }

    @Override
    public Integer saveWarehouseBin(String version) {
        this.updateFlag2(version);
        Integer result = 0;
        result += this.updateWarehouseBin(version);
        result += this.insertIntoWarehouseBin(version);
        return result;
    }

    @Override
    public Integer saveWarehouseBinSkus(String version) {
        Integer result = 0;
        result += this.updateWarehouseBinSkus(version);
        result += this.insertIntoWarehouseBinSkus(version);
        return result;
    }

    @Override
    public Integer updateFlag2(String version) {
        return baseMapper.updateFlag2(version);
    }

    @Override
    public void clearAll() {
        baseMapper.clearAll();
    }

    @Override
    public List<TmpSyncLingxingToWarehousebin> getWarehouseBin(List<TmpSyncLingxingToWarehousebin> warehouseList) {
        return baseMapper.getWarehouseBin(warehouseList);
    }
}
